package com.qingchunlin.springaop.aspect;

import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Slf4j
@Aspect
@Component
public class TestAnnotationAspect {
    @Before("@annotation(com.qingchunlin.springaop.aspect.TestAnnotation)")
    public void doBefore(){
        log.info("执行TestAnnotationAspect Before...");
    }

    @After("@annotation(com.qingchunlin.springaop.aspect.TestAnnotation)")
    public void doAfter(){
        log.info("执行TestAnnotationAspect After...");
    }

    @AfterReturning("@annotation(org.springframework.web.bind.annotation.RequestMapping)")
    public void doAfterReturning() {
        log.info("执行TestAnnotationAspect AfterReturning...");
    }
}
